package com.deuwise.system.entity;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.deuwise.common.validator.group.AddGroup;
import com.deuwise.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * Copyright
 *
 * @author chenwenchao
 * @date 2019/12/24
 * Description:
 */
@Data
public class MenuExport {

    /**唯一主键*/
    @ApiModelProperty("唯一主键")
    @TableField("id")
    @TableId
    private String id;

    /**菜单名称*/
    @ApiModelProperty("菜单名称")
    @TableField("name")
    @NotBlank(message ="菜单名称不能为空",groups = {AddGroup.class, UpdateGroup.class})
    @Length(max =60,message ="菜单名称长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String name;

    /**菜单URL*/
    @ApiModelProperty("菜单URL")
    @TableField("url")
    @Length(max =120,message ="菜单URL长度不能超过{max}",groups ={AddGroup.class, UpdateGroup.class})
    private String url;

    /**菜单图标*/
    @ApiModelProperty("菜单图标")
    @TableField("icon")
    private String icon;

    @TableField(exist=false)
    private List<?> list;
}
